/***************************************************************************
 *   Copyright (C) 2009 by maarten,,,   *
 *   maarten@maarten-laptop   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef DRAWRAY_H
#define DRAWRAY_H

#include <QString>

namespace object{
    class Vertex;
}
namespace draw {

/**
	@author maarten,,, <maarten@maarten-laptop>
*/
class Ray{
public:
    Ray();
    Ray(object::Vertex *origin, object::Vertex *destination);
    Ray(object::Vertex *origin, object::Vertex *direction, bool dir);
    ~Ray();
    void init(object::Vertex *origin, object::Vertex *destination);

    inline void setOrigin ( object::Vertex* val ){m_origin = val;}
    inline void setDirection ( object::Vertex* val ){m_direction = val;}

    inline object::Vertex* origin() const{return m_origin;}
    inline object::Vertex* direction() const{ return m_direction;}
    
    inline float getInvX(){return inv_xDir;}
    inline float getInvY(){return inv_yDir;}
    inline float getInvZ(){return inv_zDir;}
    
    
    
private:
    object::Vertex *m_origin;
    object::Vertex *m_direction;
    
    float inv_xDir;
    float inv_yDir;
    float inv_zDir;
    
    bool deleteOrigin;

};

}

#endif
